<!DOCTYPE html>
<html>

	<head>
		<title>我的消息</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
			<script src="/js/jquery/jquery.min.js"></script>
			<script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
			<link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
			<link rel="stylesheet" href="/css/reset.css"/>
			<link rel="stylesheet" href="/css/message.css" />
			<link rel="stylesheet" href="/css/style.css" />
			<script src="/js/plugins/jrender/jrender.min.js"></script>
			<link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
			<script src="/js/plugins/dialog2/dialog.min.js"></script>
			<script src="/js/plugins/form/jquery.form.js"></script>

			<script>
				$(function () {
					$.get("/users/systemNotificationNum",function (data) {
                        console.log(data);
                        if (data) {
                            $("span[name='num']").html(data)
                        }else {
                            $("span[name='num']").remove();
						}
                    })
                })
			</script>

	</head>

<script>
	$(function () {

        var  user =JSON.parse(sessionStorage.getItem("user"));
		//查询当前登录用户未读私信的总数
		$.get("/privateMessages/states",{id:user.id},function (data) {
            if (data) {
                //有值则拼接在小红圈上
                $("#privateTotal").html(data);
            } else {
                //没值则删除小红圈
                $("#privateTotal").remove();
            }
        })
		$(".privateTotal").click(function () {
            $.get("/privateMessages/privateTotals",{id:user.id},function (data) {
            })
        })
        //lituan
		$.get("/users/beCommentCounts",function (data) {
            if (data > 0) {
           	 	$("#commentCount").html(data);
            }else{
                $("#commentCount").remove();
			}
        })

		//查询赞的总数
        $.get("/users/praiseNum",function (data) {
            console.log(data);
            var praiseTotalNum = data.travel + data.strategyComment + data.friendship;
            if (praiseTotalNum) {
                $(".praise").html(praiseTotalNum);
            }else {
                $(".praise").css("display","none");
			}
        });

        $("#parseQRCode").click(function () {
            $("#QRCodeFile").click();
        })

        $("#QRCodeFile").change(function () {
            if ($(this).val()) {
                $("#QRCodeForm").ajaxSubmit(function (data) {
                    console.log(data);
                    location.href="/userProfiles.html?id="+data;
                })
            }
        })
    })

</script>
	<body>
	<form id="QRCodeForm"  action="/QRCodes" method="post" enctype="multipart/form-data">
		<input type="file" id="QRCodeFile" name="file" style="display: none" accept="image/*">
	</form>



		<header class="aui-navBar">
			<a href="/mine/profiles.html">
				<span><i class="fa fa-chevron-left" ></i></span>
			</a>
			<div class="aui-center">
				<span class="aui-center-title">我的消息</span>
			</div>
			<a href="javascript:;" class="aui-navBar-item select">
				<i class="icon icon-add"></i>
				<div class="aui-dow-box selectList">
					<div class="aui-dow-box-list">
						<div href="javascript:;" class="aui-dow-box-item">
							<div class="aui-dow-box-item-image">
								<img src="/peopleList/images/icon-we01.png" alt="">
							</div>
							<div class="aui-dow-box-item-title" id="CreateAGroupChat">发起群聊</div>
							<script>
                                $("#CreateAGroupChat").click(function () {
                                    window.location.href = "/mine/CreateAGroupChat.html";
                                })
							</script>
						</div>
						<div href="javascript:;" class="aui-dow-box-item">
							<div class="aui-dow-box-item-image">
								<img src="/peopleList/images/icon-we02.png" alt="">
							</div>
							<div class="aui-dow-box-item-title" id="addParents">添加朋友</div>
							<script>
								$("#addParents").click(function () {
									window.location.href = "/mine/search.html";
                                })
							</script>
						</div>

						<div id="parseQRCode"  href="javascript:;" class="aui-dow-box-item">
							<div class="aui-dow-box-item-image">
								<img src="/peopleList/images/icon-we03.png" alt="">
							</div>
							<div class="aui-dow-box-item-title">扫一扫</div>
						</div>

						<div href="javascript:;" class="aui-dow-box-item">
							<div class="aui-dow-box-item-image">
								<img src="/peopleList/images/icon-we04.png" alt="">
							</div>
							<div class="aui-dow-box-item-title">收付款</div>
						</div>
						<div href="javascript:;" class="aui-dow-box-item">
							<div class="aui-dow-box-item-image">
								<img src="/peopleList/images/icon-we05.png" alt="">
							</div>
							<div class="aui-dow-box-item-title">帮助与反馈</div>
						</div>
					</div>
				</div>
			</a>
		</header>



		<ul class="list-group">
			<a href="/mine/praiseSort.html">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-thumbs-o-up" ></i></span>
						<span>赞</span>
						<span class="badge badge-danger badge-pill praise"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<a href="../index.html">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-at" ></i></span>
						<span>@我的</span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<a href="commentMessage.html">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-commenting-o" ></i>	</span>
						<span>评论</span>
						<span id="commentCount" class="badge badge-danger badge-pill"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<a href="/mine/peopleList.html" class="privateTotal">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-envelope-o" ></i></span>
						<span>	私信</span>
						<span id="privateTotal" class="badge badge-danger badge-pill"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<a href="/mine/systemNotification.html" id="system">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-bell" ></i></span>
						<span>系统通知</span>
						<span class="badge badge-danger badge-pill" name="num"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<a href="/mine/groupChat.html" id="groupChat">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa  fa-users" ></i></span>
						<span>我的群聊</span>
						<span class="badge badge-danger badge-pill" ></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>

			<a href="/mine/dynamic.html" id="">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa  fa-recycle fa-2x" ></i></span>
						<span>朋友圈</span>
						<span class="badge badge-danger badge-pill" ></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
		</ul>
		

	<script>
		$(function () {
            $(function() {

                var oDropDown = $('.select');
                var oChangeA = $('.listA');
                oDropDown.click(function() {
                    $(this).find('.selectList').toggle().siblings('.xl-icon').toggleClass('sq-icon');
                });

                oDropDown.mouseleave(function() {
                    $(this).find('.selectList').hide().siblings('.xl-icon').removeClass('sq-icon');
                });

            });
        })
	</script>
	</body>

</html>